<style>
    .table-wrap td {
        padding: 5px;
    }

    .parent_broker {
        cursor: pointer;
        text-indent: -9999px;
        display: inline-block;
        width: 13px;
        height: 30px;
        padding: 0 6px 0 10px;
        vertical-align: middle;
        margin-left: -4%;
        background: url('http://img-dev.myscrmimg.cn/projects/qmyx/public/images/icon/icon_plus.png') no-repeat 10px 11px;
    }

    .collapseIc {
        background: url('http://img-dev.myscrmimg.cn/projects/qmyx/public/images/icon/icon_minus.png') no-repeat 10px 11px
    }

    .subItem {
        padding-left: 20px;
    }

    .trCollapseHide {
        display: none;
    }

    .table-wrap {
        min-height: 100%;
    }

    .table-wrap {
        border-bottom: none;
    }

    .no-data {
        border-bottom: 1px solid #dcdcdc;
    }
    .table-wrap td {
        border-bottom: 1px solid #dcdcdc !important;
    }
</style>
<div ng-cloak ng-controller="invitationController">
    <div class="search mt15 clearfix ">
        <div style="width:120px" class="fl">
            <div ui-combobox data="search.fieldList" text-field="text" value-field="value"
                 ng-model="search.queryKey"></div>
        </div>
        <input type="text" class="input-text fl ng-pristine ng-untouched ng-valid permission p-50030606-00-inline-block"
               ng-enter="getSearchData()" ng-model="search.keyword" style="width:327px">
        <button class="fl btn" ng-click="getSearchData()">搜索</button>
    </div>

    <div class="mt20 clearfix ">
        <span class="fl lh30 ng-binding">注册时间：</span>
        <input type="text" class="input-text input-data fl ng-pristine ng-valid" readonly
               ui-date format="yyyy-MM-dd"
               id="start_date" max-date="#F{$dp.$D(\'end_date'\)}"
               ng-model="filter.startDate">
        <span class="fl lh30">&nbsp;&nbsp;-&nbsp;&nbsp;</span>
        <input type="text" class="input-text input-data fl ng-pristine ng-untouched ng-valid" readonly
               ui-date format="yyyy-MM-dd"
               id="end_date" min-date="#F{$dp.$D(\'start_date'\)}"
               ng-model="filter.endDate">
        <a href="javascript: void(0)" class="btn fl mlr5 permission p-50030606-00-inline-block"
           ng-click="getFilterData()">查询</a>
        <a href="javascript: void(0)" class="btn btn-gray fl" ng-click="filter.clearFilter()">撤销筛选</a>
    </div>


    <div class="table-header mt20 clearfix ">
        <span class="fl lh30 f14">下线经纪人列表</span>

        <div class="fr btn-group">
            <a href="javascript: void(0)" class="btn btn-yellow" ng-click="exportData($event)">导出</a>
        </div>
    </div>
    <div id="grid" class="table-wrap mt10">
        <table width="100%">
            <thead>
            <tr>
                <th class="text-center" width="80">序号</th>
                <th  width="200">姓名</th>
                <th >身份信息</th>
                <th  width="100">下线经纪人数</th>
                <th >上线经纪人</th>
                <th  width="100">是否已退出登录</th>
                <th  width="150">注册时间</th>
            </tr>
            </thead>

            <tbody ng-if="loading">
            <tr height="60">
                <td colspan="8">加载中...</td>
            </tr>
            </tbody>


            <!-- ngRepeat: record in query.data -->

            <tbody ng-if="!loading && list && list.length>0" ng-repeat="item in list">
            <tr ng-mouseover="item.hover = true"
                ng-mouseleave="item.hover = false">
                <td height="60">
                    <div class="text-center">
                        <label>{{filter.pageSize*(pageIndex-1)+$index+1}}</label>
                    </div>
                </td>
                <!-- 姓名 -->
                <td>
                    <span class="fl" style="width: 100%;">
                        <a ng-if="item.invite_brokers" class="parent_broker fl"
                           ng-click="toggleSubBrokers($event)">►</a>
                        {{item.broker_name}}<span ng-if="item.gender">（{{item.gender}}）</span></br>{{item.mobile_tel}}
                    </span>
                </td>
                <!-- 身份信息 -->
                <td>
                    <span class="fl" style="width: 100%;">{{item.capacity_des_info}}</span>
                    <span class="fl" ng-if="item.belongs_company_info" style="width: 100%;">所属公司:{{item.belongs_company_info}}</span>
                    <span class="fl" ng-if="item.store_code" style="width: 100%;">门店邀请码:{{item.store_code}}</span>

                </td>
                <!-- 下线经纪人数 -->
                <td><span class="c-orange" style="cursor: pointer;" ng-click="toggleSubBrokers($event)">{{item.invite_count}}</span>
                </td>
                <!-- 上线经纪人 -->
                <td>
                    <span class="fl" ng-if="item.parent_broker" style="width: 100%;">{{item.parent_broker.broker_name}}({{item.parent_broker.gender}})</span>
                    <span class="fl" ng-if="item.parent_broker"
                          style="width: 100%;">{{item.parent_broker.mobile_tel}}</span>
                </td>
                <!-- 是否已退出登录 -->
                <td>{{item.isquit_info}}</td>
                <!-- 注册时间 -->
                <td>{{item.reg_date}}</td>
            </tr>
            <tr ng-if="item.invite_brokers" ng-repeat="subItem in item.invite_brokers"
                ng-mouseover="subItem.hover = true"
                class="trCollapseHide" ng-mouseleave="subItem.hover = false">
                <td height="60">
                    <div class="text-center">
                        <label>{{subItem.indexNum}}</label>
                    </div>
                </td>
                <!-- 姓名 -->
                <td>
                    <span class="fl subItem" style="width: 100%;">{{subItem.broker_name}}<span ng-if="subItem.gender">（{{subItem.gender}}）</span></span>
                    <span class="fl subItem" style="width: 100%;">{{subItem.mobile_tel}}</span>
                </td>
                <!-- 身份信息 -->
                <td>
                    <span class="fl" style="width: 100%;">{{subItem.capacity_des_info}}</span>
                    <span class="fl" ng-if="subItem.belongs_company_info" style="width: 100%;">所属公司:{{subItem.belongs_company_info}}</span>
                    <span class="fl" ng-if="subItem.store_code" style="width: 100%;">门店邀请码:{{subItem.store_code}}</span>

                </td>
                <!-- 下线经纪人数 -->
                <td>{{subItem.invite_count}}</td>
                <!-- 上线经纪人 -->
                <td>
                    <span class="fl" style="width: 100%;">{{item.broker_name}}<span ng-if="item.gender">（{{item.gender}}）</span></span>
                    <span class="fl" style="width: 100%;">{{item.mobile_tel}}</span>
                </td>
                <!-- 是否已退出登录 -->
                <td>{{subItem.isquit_info}}</td>
                <!-- 注册时间 -->
                <td>{{subItem.reg_date}}</td>
            </tr>
            </tbody>
            <!-- end ngRepeat: record in query.data -->
        </table>
        <div class="no-data" ng-if="!loading && (!list || list.length==0)"><span>暂无数据</span></div>
    </div>
    <div ui-pagination page-index="pageIndex" page-size="filter.pageSize" total="total"
         changed="getSearchData($pageIndex)"></div>
</div>
